home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2003 June / macformat-130.iso / mac / Reviewed⁄Demos / Spearhead Demo / demota / pak1.pk3 / global / shootatloop.scr < prev    next >
Encoding:
Text File  |  2002-10-21  |  972 b   |  49 lines

  1. // tells AI to aim and then keep shooting
  2. // can give the AI two targets. it will shoot at one until its dead then shoot at the next one.
  3. //defaults to 8 shots 
  4.  
  5. start local.target local.target2 local.reload:
  6. local.time_between_shots = .6
  7. if (local.reload == NIL)
  8. {
  9. local.reload = 8
  10. }
  11. //println "local reload" 
  12. //println local.reload
  13. local.i = 0
  14.  
  15. while (local.target.health != 0 && local.target != NULL)
  16. {
  17. self exec global/headaim.scr local.target 50 0
  18. wait .1
  19. self exec global/shoot.scr
  20. wait local.time_between_shots
  21. //println "shot number: " local.i
  22. local.i ++
  23. if (local.i == local.reload)
  24.     {
  25.     //println "reloading"
  26.     wait 3
  27.     local.i = 0
  28.     }
  29. }
  30.  
  31. if(local.target2 == NIL)
  32. {
  33. end
  34. }
  35.  
  36. while (local.target2.health != 0 && local.target2 != NULL)
  37. {
  38. self exec global/headaim.scr local.target 50 0
  39. wait .1
  40. self exec global/shoot.scr
  41. wait local.time_between_shots
  42. local.i ++
  43. if (local.i == local.reload)
  44.     {
  45.     wait 3
  46.     local.i = 0
  47.     }
  48. }
  49. end